package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbGarbageMailMapper;
import com.ruoyi.system.domain.TbGarbageMail;
import com.ruoyi.system.service.ITbGarbageMailService;

/**
 * 反垃圾邮件表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-18
 */
@Service
public class TbGarbageMailServiceImpl implements ITbGarbageMailService 
{
    @Autowired
    private TbGarbageMailMapper tbGarbageMailMapper;

    /**
     * 查询反垃圾邮件表
     * 
     * @param spamId 反垃圾邮件表主键
     * @return 反垃圾邮件表
     */
    @Override
    public TbGarbageMail selectTbGarbageMailBySpamId(Long spamId)
    {
        return tbGarbageMailMapper.selectTbGarbageMailBySpamId(spamId);
    }

    /**
     * 查询反垃圾邮件表列表
     * 
     * @param tbGarbageMail 反垃圾邮件表
     * @return 反垃圾邮件表
     */
    @Override
    public List<TbGarbageMail> selectTbGarbageMailList(TbGarbageMail tbGarbageMail)
    {
        return tbGarbageMailMapper.selectTbGarbageMailList(tbGarbageMail);
    }

    /**
     * 新增反垃圾邮件表
     * 
     * @param tbGarbageMail 反垃圾邮件表
     * @return 结果
     */
    @Override
    public int insertTbGarbageMail(TbGarbageMail tbGarbageMail)
    {
        tbGarbageMail.setCreateTime(DateUtils.getNowDate());
        return tbGarbageMailMapper.insertTbGarbageMail(tbGarbageMail);
    }

    /**
     * 修改反垃圾邮件表
     * 
     * @param tbGarbageMail 反垃圾邮件表
     * @return 结果
     */
    @Override
    public int updateTbGarbageMail(TbGarbageMail tbGarbageMail)
    {
        return tbGarbageMailMapper.updateTbGarbageMail(tbGarbageMail);
    }

    /**
     * 批量删除反垃圾邮件表
     * 
     * @param spamIds 需要删除的反垃圾邮件表主键
     * @return 结果
     */
    @Override
    public int deleteTbGarbageMailBySpamIds(Long[] spamIds)
    {
        return tbGarbageMailMapper.deleteTbGarbageMailBySpamIds(spamIds);
    }

    /**
     * 删除反垃圾邮件表信息
     * 
     * @param spamId 反垃圾邮件表主键
     * @return 结果
     */
    @Override
    public int deleteTbGarbageMailBySpamId(Long spamId)
    {
        return tbGarbageMailMapper.deleteTbGarbageMailBySpamId(spamId);
    }
}
